#ifndef CONTROLSPAGE_H
#define CONTROLSPAGE_H

#include <QWidget>

#include <dwaterprogress.h>
#include <dcircleprogress.h>
#include <dimagebutton.h>

#include <DCommandLinkButton>
#include <DPushButton>
#include <DFileChooserEdit>
#include <DTextEdit>
#include <dswitchbutton.h>

#include <dlineedit.h>
#include <dsearchedit.h>
#include <dpasswordedit.h>
#include <dipv4lineedit.h>

#include <darrowrectangle.h>
#include <dtoast.h>
#include <dlabel.h>

DWIDGET_USE_NAMESPACE

class ControlsPage : public QWidget
{
    Q_OBJECT
public:
    explicit ControlsPage(QWidget *parent = nullptr);

protected:
    void showEvent(QShowEvent *event);
    void pictureConvertBase64(const QString &filename);
    void textConvertBase64(const QString &text);
    void base64ConvertText();
    void base64ConvertImage();


private:

    DLineEdit *m_lineEdit;
    DArrowRectangle *m_arrowRectangle;

    DFileChooserEdit *m_picPathEdit = nullptr; //图片路径
    DTextEdit *m_edit; //多行文本输入框
    DToast *m_toast;
    DLabel *m_labImage;

    DPushButton *m_btnClear;
    DPushButton *m_btnBase64ToText;
    DPushButton *m_btnBase64ToImage;

    void initUI();
    void initConnections();
};

#endif // CONTROLSPAGE_H
